//
//  NSDictionary+KCSafety.h
//  KCDriver
//
//  Created by bjkcwl-fth on 2020/9/16.
//  Copyright © 2020 bjkcwl. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSDictionary <KeyType, ObjectType> (KCSafety)

/// 取值(防止为Null) 注意：此方法只适用于key为NSString的字典调用 防止传入其他类型造成错误
/// @param key key
- (ObjectType)safeObjectForKey:(NSString *)key;

@end

@interface NSMutableDictionary (KCSafety)

/// 删除akey对应value  注意：此方法只适用于key为NSString的字典调用 防止传入其他类型造成错误
/// @param aKey key值
- (void)safeRemoveObjectForKey:(NSString *)aKey;

/// 增/改 akey对应的value  注意：此方法只适用于key为NSString的字典调用 防止传入其他类型造成错误
/// @param anObject value值
/// @param aKey key值
- (void)safeSetObject:(id)anObject forKey:(NSString *)aKey;


/// 从字典取键值对 合并字典
/// @param otherDictionary 被合并的d字典
- (void)safeSetDictionary:(NSDictionary *)otherDictionary;

@end

NS_ASSUME_NONNULL_END
